<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// 不用switch,要求简化代码
			function test(day) {
				var arr = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

				arr[day - 1] !== undefined ? console.log(arr[day - 1])
										   : console.log('I don\'t know');
										   
			}
			
			test(7);
			
			// 不要减1
			function test(day) {
				var arr = [,'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
			
				arr[day] !== undefined ? console.log(arr[day])
										   : console.log('I don\'t know');
										   
			}
			
			test(7);
		</script>
	</body>
</html>
